From 6d67f4dff4836c6bcc0f47f3822624305ce77c34 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Fri, 15 Jul 2005 12:52:02 +0000 Subject: [PATCH] Relax the bounce-buffer copying constraints in dma_sync_single_for_* functions. This fixes certain drivers (e.g., ivtv). Signed-off-by: Keir Fraser --- linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c | 4 ++-- linux-2.6-xen-sparse/arch/xen/x86_64/kernel/pci-dma.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c b/linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c index 1fdda04395..dae139a065 100644 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c @@ -248,7 +248,7 @@ dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, if (&ent->list != &dma_map_head) { off = dma_handle - ent->dma; BUG_ON((off + size) > ent->size); - if (direction != DMA_TO_DEVICE) + /*if (direction != DMA_TO_DEVICE)*/ memcpy(ent->host+off, ent->bounce+off, size); } } @@ -272,7 +272,7 @@ dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t siz if (&ent->list != &dma_map_head) { off = dma_handle - ent->dma; BUG_ON((off + size) > ent->size); - if (direction != DMA_FROM_DEVICE) + /*if (direction != DMA_FROM_DEVICE)*/ memcpy(ent->bounce+off, ent->host+off, size); } } diff --git a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/pci-dma.c b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/pci-dma.c index b21c7df4f0..be30d893da 100644 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/pci-dma.c +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/pci-dma.c @@ -302,7 +302,7 @@ dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, if (&ent->list != &dma_map_head) { off = dma_handle - ent->dma; BUG_ON((off + size) > ent->size); - if (direction != DMA_TO_DEVICE) + /*if (direction != DMA_TO_DEVICE)*/ memcpy(ent->host+off, ent->bounce+off, size); } } @@ -326,7 +326,7 @@ dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t siz if (&ent->list != &dma_map_head) { off = dma_handle - ent->dma; BUG_ON((off + size) > ent->size); - if (direction != DMA_FROM_DEVICE) + /*if (direction != DMA_FROM_DEVICE)*/ memcpy(ent->bounce+off, ent->host+off, size); } } -- 2.30.2